package com.buer.train.business.service.impl;

import com.buer.train.business.dao.VersionDao;
import com.buer.train.business.domain.VersionDO;
import com.buer.train.business.service.VersionService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;



@Service
public class VersionServiceImpl implements VersionService {
	@Autowired
	private VersionDao versionDao;
	
	@Override
	public VersionDO get(Integer id){
		return versionDao.get(id);
	}
	
	@Override
	public List<VersionDO> list(Map<String, Object> map){
		return versionDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return versionDao.count(map);
	}
	
	@Override
	public int save(VersionDO version){
		return versionDao.save(version);
	}
	
	@Override
	public int update(VersionDO version){
		return versionDao.update(version);
	}
	
	@Override
	public int remove(Integer id){
		return versionDao.remove(id);
	}
	
	@Override
	public int batchRemove(Integer[] ids){
		return versionDao.batchRemove(ids);
	}

    @Override
    public PageInfo<VersionDO> getVersionList(Map<String, Object> map) {
        PageHelper.startPage(map); //开始起始页
        List<VersionDO> list = versionDao.getVersionList(map); // 获取数据
        PageInfo<VersionDO> page = new PageInfo<>(list); // 实例化PageInfo
        return page;
    }

    @Override
    public VersionDO getOne(Map<String, Object> map){
        return versionDao.getOne(map);
    }
	
}
